/**
opts = {
  lng: 116.405285,
  lat: 39.905888,
  text: {
    value: '5.6',
    color: 'green',
    size: '20px',
    weight: 'bold',
  },
  point: {
    color: 'green',
    radius: 4,
    overColor: 'red'
  },
  click: function(e){
    alert(e)
  }
}
**/
AMapUI.loadUI(['overlay/SimpleMarker'], function(SimpleMarker) {
  window.SimpleMarker = SimpleMarker;
});
function RainMarker(opts) {
  var marker = new SimpleMarker({
    iconLabel : {
      innerHTML : opts.text.value,
      style : {
        color : opts.text.color,
        fontSize : opts.text.size,
        fontWeight: opts.text.weight,
        left : '-3px',
        top : '0px'
      }
    },
    iconStyle : {
      src : './images/empty.png',
      style : {
        width : '30px',
        height : '37px',
        border : '0px'
      }
    },
    showPositionPoint : {
      color : opts.point.color,
      radius : opts.point.radius
    },
    position : [opts.lng, opts.lat],
    shape : new AMap.MarkerShape({
      coords : [ 9, 32, opts.point.radius + 1],
      type : 'circle'
    })
  });
  marker.on("click", function(e) {
    opts.click(e);
  })
  marker.on("mouseover", function(e) {
    e.target.showPositionPoint({
      color : opts.point.overColor,
      radius : opts.point.radius + 1
    });
  })
  marker.on("mouseout", function(e) {
    e.target.showPositionPoint({
      color : opts.point.color,
      radius : opts.point.radius
    });
  });
  return marker;
}